<include file="public@header"/>

<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('Information/index')}">待办信息列表</a></li>
        <li class="active"><a href="{:url('Information/add')}">信息添加</a></li>
    </ul>
    <div class="row margin-top-20">
        <div class="col-md-10 col-md-offset-2">
            <form action="{:url('Information/addPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
                <div class="row">
                    <div class="col-md-9">
                        <table class="table table-bordered chase_classroom_table">
                            <tr>
                                <th>校区<span class="form-required">*</span></th>
                                <td>
                                    <select class="form-control" name="school_id" id="input-parent" style="width: 180px;">
                                        <option value='0'>全部</option>
                                        <notempty name="campus">
                                            <volist name="campus" id="vo">
                                                <option value="{$vo.id}">{$vo.name}</option>
                                            </volist>
                                        </notempty>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <th>标题<span class="form-required">*</span></th>
                                <td>
                                    <input type="text" class="form-control"  id="input-title" name="title" value="">
                                </td>
                            </tr>
                            <tr>
                                <th>内容<span class="form-required">*</span></th>
                                <td>
                                    <textarea class="form-control" id="input-content" name="content" rows="8"></textarea>
                                </td>
                            </tr>
                            <tr>
                                <th>完成者<span class="form-required">*</span></th>
                                <td>
                                    <input type="text" class="form-control" id="solved_uid" name="solve" value="">
                                    <input type="hidden" class="form-control" id="cur_solved_uid" name="solved_uid" value="">
                                </td>
                            </tr>
                        </table>

                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
                                <a class="btn btn-default" href="{:url('Information/index')}">{:lang('BACK')}</a>
                            </div>
                        </div>
                    </div>
                </div>
            </form>

        </div>
    </div>
</div>
<!--ajax layer 弹窗-->
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript" src="__STATIC__/js/jquery.autocomplete.js"></script>

<script type="text/javascript">
    $(document).ready(function() {
        var countries = [
            { value: 'Andorra', data: 'AD' },
            { value: 'Zimbabwe', data: 'ZZ' }
        ];
        var url = "{:url('Information/ajax_user')}";

        $('#solved_uid').devbridgeAutocomplete({
            serviceUrl: url,
            //lookup: countries,
            autoSelectFirst: true,
            minChars: 1,
            showNoSuggestionNotice: true,
            onSelect: function (suggestion) {
                //设置完成者ID
                $('#cur_solved_uid').val(suggestion.data);
            }
        });
    });

</script>

</body>
